<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.dao.CommonDAO"%>
<%@page import="com.util.Info"%>
<%@page import="com.model.Ppinfo"%>
<%@page import="com.model.Goods"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'foot.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <div class="col-md-3 rsidebar span_1_of_left">
				<section  class="sky-form">
					<div class="product_right">
						<h4 class="m_2"><span class="glyphicon glyphicon-minus" aria-hidden="true"></span>热销排行</h4>
						<div class="tab1">
							<div class="clearfix"> 
							<%
							   CommonDAO dao = (CommonDAO)Info.getDao(request,"CommonDAO"); 
								String hql = " select COUNT(carid) as cs,carid from Ddinfo where 1=1 and zystatus='已归还' GROUP BY carid ORDER BY carid DESC";
								ArrayList<Object[]> pplist  = (ArrayList<Object[]>)dao.findByHql(hql);
								for(Object[] obj:pplist){
								Goods g = (Goods)dao.findById(obj[1].toString(),"Goods");
								%>				
							<ul>
								  <li style="list-style-type:none;"><img alt="" src="/bookborrowssh/upfile/<%=g.getFilename() %>" width="100" height="100"></li>
						    </ul>
						    <ul>
								  <li style="list-style-type:none;"><%=g.getGoodname() %></li>
						    </ul>
						    <%} %>
							</div>
							<div class="single-bottom">		
						    </div>
						    
					    </div>						  
						
						<!--script-->
						<script>
							$(document).ready(function(){
								$(".tab1 .single-bottom").hide();
								
								$(".tab1 ul").click(function(){
									$(".tab1 .single-bottom").slideToggle(300);
								})
								
							});
						</script>
						<!--//script -->	
					</div>
				</section>
					 
			</div>
  </body>
</html>
